﻿Public Class ChuyenMonDAO
    Public Shared Function SelectAll() As DataTable
        Dim strSQL As String = "select * from CHUYENMON"
        Dim dt As DataTable
        dt = Provider.ExecQuery(strSQL)
        Return dt
    End Function

    Public Shared Sub Insert(ByVal _cm As ChuyenMonDTO)
        Dim strSQL As String = "Insert into CHUYENMON(TenChuyenMon)Values('" & _cm.TenChuyenMon & "')"
        Provider.ExecNoneQuery(strSQL)
    End Sub

    Public Shared Sub Delete(ByVal _cm As ChuyenMonDTO)
        Dim strSQL As String = "delete from CHUYENMON where MaChuyenMon = " & _cm.MaChuyenMon
        Provider.ExecNoneQuery(strSQL)
    End Sub

    Public Shared Sub Update(ByVal _cm As ChuyenMonDTO)
        Dim strSQL As String = "Update CHUYENMON set TenChuyenMon = '" & _cm.TenChuyenMon & "' Where MaChuyenMon = " & _cm.MaChuyenMon
        Provider.ExecNoneQuery(strSQL)
    End Sub
End Class
